<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1, user-scalable=no">
    <meta http-equiv="X-UA-Compatible" content="ie=edge,chrome=1">
    <meta name="author" content="程月">
    <title>名车展示</title>
    <style>
          *{
              box-sizing: border-box;
          }
            main{
                width: 700px;
                height: 400px;
                margin: 0 auto;
                border: 1px  solid palevioletred;
            }
            ul{
                margin: 0;
                padding: 0;
                list-style: none;
                display: flex;
                justify-content: space-between;
                flex-wrap: wrap;
                margin-top: 20px;
            }
            li{
                width: 125px;
                height: 125px;
                background-color: #aaa;
                margin: 10px 0;
                text-align: center;
                 /* display: inline-block;  */
                 position: relative;
            }
            h2{
                text-align: center;
            }
            img{
                 opacity: 0; 
                 /* display: inline-block;  */
                 position: absolute;
                 top: 0;
                 left: 0;
            }
            li:hover img{
                opacity: 1;
            }

    </style>
</head>
<body>
     <main>
         <h2>名车展示</h2>
         <ul>
             <li>
                 BMW <br>宝马汽车
                 <img src="img/1.jpg" alt=""></li>
             <li>BMW<br>宝马汽车<img src="img/2.jpg" alt=""></li>
             <li>BMW<br>宝马汽车<img src="img/3.jpg" alt=""></li>
             <li>BMW<br>宝马汽车<img src="img/4.jpg" alt=""></li>
             <li>BMW<br>宝马汽车<img src="img/5.jpg" alt=""></li>
             <li>BMW<br>宝马汽车<img src="img/6.jpg" alt=""></li>
             <li>BMW<br>宝马汽车<img src="img/7.jpg" alt=""></li>
             <li>BMW<br>宝马汽车<img src="img/8.jpg" alt=""></li>
             <li>BMW<br>宝马汽车<img src="img/9.jpg" alt=""></li>
             <li>BMW<br>宝马汽车<img src="img/10.jpg" alt=""></li>
         </ul>
     </main>
</body>
</html>